import 'package:flutter/material.dart';
import 'package:flutter_bmfmap_example/componets/text/text_field_container.dart';

class PassWordField extends StatefulWidget {
  PassWordField({Key key, this.onChanged,this.hintText}) : super(key: key);

  final String hintText;
  ValueChanged<String> onChanged;

  @override
  _PassWordFieldState createState() => _PassWordFieldState();
}

class _PassWordFieldState extends State<PassWordField> {
  bool _isshow = true;



  @override
  Widget build(BuildContext context) {
    return TextFieldContainer(
      child: TextField(
        obscureText: _isshow,
        onChanged: widget.onChanged,
        cursorColor: Colors.black54,
        decoration: InputDecoration(
          hintText: widget.hintText,
          icon: Icon(
            Icons.lock,
            color: Color.fromRGBO(172, 172, 172, 1),
          ),
          suffixIcon: InkWell(
            onTap: () {
              _isshow = !_isshow;
              setState(() {});
            },
            child: Icon(
              Icons.visibility,
              color: Color.fromRGBO(172, 172, 172, 1),
            ),
          ),
          border: InputBorder.none,
        ),
      ),
    );
  }
}
